This invention relates to an access mechanism for making access to a memory such as a large capacity register file by use of a pointer, and more particularly to a method and apparatus for memory access which can simplify a pointer (address) generation circuit and improve its operation speed and is suitable for making an access method versatile.
In conventional systems such as Sword 32, an activation record (context) as data having high access frequency is allocated to a register file to which access can be made at a high speed, as described, for example, in Proceeding of the International Conference on Fifth Generation Computer Systems, (1984), p.p. 389-397.
In accordance with a method of keeping the activation records by an ordinary software, they are linearly allocated on one stack and access to all the data in the activation records is made in correspondence to a pointer. However, the activation records consist of an area which contains control information for procedure execution which has the same size and a stack area whose size is not always constant.
In Sword 32 described above, the system has a function of making it possible to use part of the register file as a bank register and the area which contains control information for procedure execution for each activation record is allocated to each bank. Furthermore, the system includes a hardware which permits the access of data in the control information for procedure execution corresponding to the activation record which is being activated at the address inside the bank in order to improve the access speed.
The Sword 32 system is designed to execute particularly efficiently a program described by Smalltalk-80 language. In a program of this Smalltalk-80 language, a compiler guarantees that no stack overflow occurs so long as the stack is pushed or popped. For this reason, the Sword 32 system is not particularly equipped with a hardware for checking the stack overflow.
In accordance with the prior art technique described above, the number of activation records allocated to register files and the number of specific registers of each register file are fixed, and no consideration is given to the fact that the ratio of the optimum number of data in the register file varies with a programming language applied and with an application program. For this reason, there is the problem as to the versatility of a microprocessor.
A program described by an ordinary programming language must detect a stack overflow during execution as to the operation of a stack push and pop and if a microprocessor is not equipped with such a detection mechanism, detection must be made by means of software causing execution efficiency to drop.
Furthermore, the prior art technique described above is not equipped with a mechanism for efficiently processing a plurality of stacks and saving and restoring processing of all the contents of a large capacity register file is necessary for every task switch causing execution efficiency to drop even further.
Depending upon application programs, on the other hand, high speed execution can be accomplished by realizing a plurality of stacks or queues for independent data management by use of register files capable of high speed access. In accordance with the prior art technique, however, no method has yet been developed which realizes a plurality of independent memory areas whose data handling is managed by pointers such as stacks, and which have freedom capable of designating a desired size by software and can efficiently realize an overflow detection mechanism by use of a memory such as a register file which is addressed unidimensionally.